var cac = {
  typeId: '',
  data: {},
  init: function (typeId) {
    if (!typeId) return
    this.typeId = typeId
    this.getPoints()
    this.getData()
    this.render()
  },
  getData: function () {
    var data = getTypeListByTypeId({ TYPEID: this.typeId })
    page.data.cac = data.TYPEs
  },
  getPoints: function () {
    var data = getPoints()
    this.data = data.data
  },
  render: function () {
    var data = page.data.cac
    var html = ''
    for (var i = 0, l = 3; i < l; i++) {
      var _html = ''
      var id = 'left-' + i
      var style = 'background-image: url(' + data[i].typePicture[0].picPath3 + ')'
      if (i == 0) {
        _html += '<div>熊猫币：' + (this.data.surplusCoin || 0) + '</div>'
        _html += '<div>活跃值：' + (this.data.surplusPoints || 0) + '</div>'
        _html += '<div>1熊猫币=' + (this.data.pointsCoin || 100) + '活跃值</div>'
      } 
      html += '<div id="' + id + '" class="item border-radius" style="' + style + '">'
      html += '<div class="container">' + _html + '</div>'
      html += '</div>'
    }
    $('#left').html(html)
  }
}